import 'package:verse_systems/utils/log_utils.dart';

class SparrowDioConfig {

  /* 设置token**/
  static String? _token;
  static String get token => _token ?? "";
  static void setToken(String token) {
    _token = token;
  }

  /* 设置language**/
  static String? _language;
  static String get language => _language ?? "zh_cn";
  static void setLanguage(String language) {
    _language = language;
  }

  /* 设置401钩子函数**/
  static void Function()? _hook401;
  static void Function()? get hook401 => _hook401;
  static void setHook401(void Function() hook401) {
    _hook401 = hook401;
  }

  /* 设置输出函数**/
  static void Function(dynamic)? _output;
  static void Function(dynamic) get output => _output ?? LogD;
  static void setOutput(void Function(dynamic) output) {
    _output = output;
  }

  /* 输出错误函数**/
  static void Function(dynamic)? _outputError;
  static void Function(dynamic) get outputError => _outputError ?? LogE;
  static void setOutputError(void Function(dynamic) outputError) {
    _outputError = outputError;
  }

  /*存储设备信息参数**/
  static Map<String, dynamic>? _deviceInfo;
  static Map<String, dynamic>? get deviceInfo => _deviceInfo ?? {};
  static void setDeviceInfo(deviceInfo) {
    _deviceInfo = deviceInfo;
  }
}
